package com.traykai.web.meeting.demo.mapper;

import java.util.List;

import com.traykai.framework.core.mybatis.mapper.MapperScannerAnnotation;
import com.traykai.web.meeting.demo.vo.ArticleVo;
import com.traykai.web.meeting.demo.vo.Comment2Vo;
import com.traykai.web.meeting.demo.vo.CommentVo;
import com.traykai.web.meeting.demo.vo.TypeVo;

/**
 * 数据库处理Mapper层
 * DemoMapper
 *
 * @author lengqx
 * @date 2016年6月15日下午2:17:28
 */
@MapperScannerAnnotation
public interface DemoMapper {

	/**
	 * 保持文章
	 * saveArticle
	 *
	 * @param articleVo
	 * @throws Exception
	 */
	public void saveArticle(ArticleVo articleVo) throws Exception;
	
	/**
	 * 根据Id查询文章内容
	 * selectArticleById
	 *
	 * @param id
	 * @return
	 */
	public ArticleVo selectArticleById(int id);
	
	/**
	 * 根据文章类型id查询文章列表
	 * selectArticleListByTypeId
	 *
	 * @param id
	 * @return
	 */
	public List<ArticleVo> selectArticleListByTypeId(int id);
	
	/**
	 * 查询所有文章列表
	 * selectArticleList
	 *
	 * @return
	 */
	public List<ArticleVo> selectArticleList();
	
	/**
	 * 根据id查询文章类型
	 * selectTypeById
	 *
	 * @param id
	 * @return
	 */
	public TypeVo selectTypeById(int id);
	
	/**
	 * 查询所有文章类型
	 * selectTypeList
	 *
	 * @return
	 */
	public List<TypeVo> selectTypeList();
	
	/**
	 * 添加评论
	 * insertComment
	 *
	 * @param commentVo
	 * @throws Exception
	 */
	public void insertComment(CommentVo commentVo) throws Exception;
	
	/**
	 * 更新评论次数
	 * updateCommentNum
	 *
	 * @param articleId
	 * @throws Exception
	 */
	public void updateCommentNum(int articleId) throws Exception;
	
	/**
	 * 根据id查询评论内容
	 * selectCommentById
	 *
	 * @param id
	 * @return
	 */
	public CommentVo selectCommentById(int id);
	
	/**
	 * 查询文章所有评论列表
	 * selectCommentsByArticleId
	 *
	 * @param articleId
	 * @return
	 */
	public List<CommentVo> selectCommentsByArticleId(int articleId);
	
	public void insertCommentCopy(Comment2Vo vo)throws Exception;
	
	public Comment2Vo selectCommentCopyById(int id);
	
	public List<Comment2Vo> selectCommentCopyChildrenByParentId(int parentId);
	
	public List<Comment2Vo> selectCommentCopysByArticleId(int articleId);
}
